//
//  SeleButton.swift
//  Slaughter
//
//  Created by Ken on 2019/5/28.
//  Copyright © 2019 zwb. All rights reserved.
//

import UIKit

import UIKit

class SeleButton: UIButton {
    
    override func awakeFromNib() {
        
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        
        
        self.setTitleColor(#colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1), for: .normal)
        self.setImage(UIImage(named:"select_no"), for: .normal)
        self.setImage(UIImage(named:"select_h"), for: .selected)
        self.titleLabel?.textAlignment = .left
        self.titleLabel?.font = UIFont.systemFont(ofSize: 15)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func layoutSubviews() {
        super.layoutSubviews()
     
        // 设置imageView
        imageView!.frame = CGRect(x: 5 , y: 0, width: self.frame.height, height: self.frame.height)
        // 设置title
        titleLabel!.frame = CGRect(x: self.frame.height + 10 , y: 0, width: self.frame.width - self.frame.height - 10 , height: self.frame.height)
        
        
    }
    
}
